let inputMaskDemo = function () {
    
    let demos = function () {
        //email
        $('#input-mask-email').inputmask({
            mask: '*{1,20}[.*{1,20}][.*{1,20}][.*{1,20}]@*{1,20}[.*{2,6}][.*{1,2}]',
            greedy: false,
            onBeforePaste: function (pastedValue, opts) {
                pastedValue = pastedValue.toLowerCase();
                return pastedValue.replace('mailto:', '');
            },
            definitions: {
                '*': {
                    validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~\-]",
                    cardinality: 1,
                    casing: 'lower'
                }
            }
        });        
    };

    return {
        init: function() {
            demos(); 
        }
    };
}();

$(document).ready(function() {
    inputMaskDemo.init();
});